<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="Template.xhtml">
        <ui:define name="top">
            #{bundle.depot}#{bundle.basic}#{bundle.info}#{bundle.manage} 

        </ui:define>
        <ui:define name="content">

            <!--<p:outputPanel deferred="true" >-->
            <!--<shiro:hasPermission name="user:V">--> 
            <h:form id="form">


                <p:panel>

                    <p:dataTable var="item" value="#{depotMB.items}" paginator="true" rows="10"
                                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                 rowsPerPageTemplate="5,10,15"   id="Table" lazy="true">
                        <!--<p:ajax event="rowSelect" listener="#{userroleMB.onRowSelect}" update=":form:detail" oncomplete="PF('detailDialog').show()" />-->

                        <p:column headerText="#{bundle.depot}#{bundle.id}" sortBy="#{item.iddepot}" filterBy="#{item.iddepot}">
                            <h:outputText value="#{item.iddepot}" />
                        </p:column>
                        <p:column headerText="#{bundle.depot}" sortBy="#{item.name}" filterBy="#{item.name}">
                            <h:outputText value="#{item.name}" />
                        </p:column>
                        <p:column headerText="#{bundle.address}" sortBy="#{item.address}" filterBy="#{item.address}">
                            <h:outputText value="#{item.address}" />
                        </p:column>
                        <p:column headerText="#{bundle.vehicle}"  >
                            <p:rowToggler  collapseLabel="点击收起" expandLabel="点击展开"  />
                        </p:column>
 
                        <p:column style="width: 20%;text-align: center;">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.operation}"/>
                                <!--<shiro:hasPermission name="user:C">--> 
                                <p:button value="#{bundle.create}#{bundle.depot}"   onclick="window.parent.addTab('#{bundle.create}#{bundle.depot}', 'depot/create.xhtml');" style="margin-left: 15px" icon="ui-icon-plus">
                                </p:button>
                                <!--</shiro:hasPermission>-->
                            </f:facet>
                            <p:commandButton value="#{bundle.view}"    onclick="window.parent.addTab(' ', ' ' + ' ');" >
                            </p:commandButton>
                            <!--<shiro:hasPermission name="user:D">--> 
                            <p:commandButton value="#{bundle.delete}" action=" " update=":form,:growl" >
                                <p:confirm header="#{bundle.delete}" message="#{bundle.deleteAlert}" icon="ui-icon-alert" />
                            </p:commandButton>
                            <!--</shiro:hasPermission>-->
                        </p:column>

                        <p:rowExpansion>
                            <ui:include src="vehicleform.xhtml" />
                            
                        </p:rowExpansion>

                    </p:dataTable>
                    <p:blockUI block="Table" trigger="Table">
                        LOADING<br />
                        <p:graphicImage name="img/ajaxloadingbar.gif"/>
                    </p:blockUI>
                </p:panel>
                <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
                    <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                    <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
                </p:confirmDialog>
            </h:form>
            
            
           
            <!--</p:outputPanel>-->
            <!--</shiro:hasPermission>-->
        </ui:define>
    </ui:composition>
</html>

